<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function fun(arr,target) {
        target = target - 0;
        for(let i =0;i<arr.length;i++){
            //取第一个数字和后面的数字相加
            for(let j=i+1;j<arr.length;j++){
                arr[i] = arr[i] -0;
                arr[j] = arr[j] -0;
                if((arr[i]+arr[j]) === target){
                    return Array(arr[i],arr[j])
                }
            }
        }
        return false

    }

    let res = fun([2, 11, 7, 15],26)
</script>
</body>
</html>